class Solution:
    def convertToTitle(self, columnNumber: int) -> str:
        res = ''
        while columnNumber > 0:
            columnNumber -= 1 # 先减1，转换为0索引
            res = chr(columnNumber % 26 + ord('A')) + res
            columnNumber //= 26
        return res
if __name__ == '__main__':
    s = Solution()
    print(s.convertToTitle(28)) # "AB"
    print(s.convertToTitle(701)) # "ZY"